import task from './province/task'
import program from './province/program'
import goods from './province/goods'
import org from './province/org'
import settle from './province/settle'
import report from './province/report'
import customer from './city/customer'
import risk from './city/risk'

export default {
  path: '/',
  component: () => import(/* webpackChunkName: "credit-app" */ '@/credit/views/city/Layout.vue'),
  meta: {
    root: true,
    title: '农业大数据信用服务平台',
    excludeJob: ['org_credit_super'],
    // job: ['org_corp', 'org_credit'],
    org: ['org_credit'],
    regionLevel: 1, // 行政级别限制
  },
  children: [
    {
      path: '',
      redirect: 'credit',
    },
    {
      path: 'credit',
      component: { render: h => h('router-view') },
      meta: { title: '信用服务', icon: 'fa fa-fw fa-home', hidden: true },
      children: [
        {
          path: '',
          redirect: 'index',
        },
        {
          path: 'index',
          component: () =>
            import(
              /* webpackChunkName: "credit-index" */ '@/credit/views/province/index/Index.vue'
            ),
          meta: { title: '主页', icon: 'fa fa-fw fa-home' },
        },
        {
          path: 'customer',
          component: () =>
            import(/* webpackChunkName: "credit-customer" */ '@/components/AliveView.vue'),
          meta: { title: '客户管理', icon: 'fa fa-fw fa-user-o' },
          children: customer,
        },
        {
          path: 'program',
          component: () =>
            import(/* webpackChunkName: "credit-province-program" */ '@/components/AliveView.vue'),
          meta: { title: '项目管理', icon: 'fa fa-fw fa-list' },
          children: program,
        },
        {
          path: 'task',
          component: { render: h => h('router-view') },
          meta: { title: '业务管理', icon: 'fa fa-fw fa-newspaper-o' },
          children: task,
        },
        {
          path: 'goods',
          component: () =>
            import(/* webpackChunkName: "credit-goods" */ '@/components/AliveView.vue'),
          meta: { title: '产品管理', icon: 'fa fa-fw fa-file-archive-o' },
          children: goods,
        },
        {
          path: 'org',
          component: () =>
            import(/* webpackChunkName: "credit-org" */ '@/components/AliveView.vue'),
          meta: { title: '合作机构', icon: 'fa fa-fw fa-address-card-o' },
          children: org,
        },
        {
          path: 'settle',
          component: () =>
            import(/* webpackChunkName: "credit-settle" */ '@/components/AliveView.vue'),
          meta: { title: '账务管理', icon: 'fa fa-fw fa-wpforms' },
          children: settle,
        },
        {
          path: 'report',
          component: () =>
            import(/* webpackChunkName: "credit-report" */ '@/components/AliveView.vue'),
          meta: { title: '台账报表', icon: 'fa fa-fw fa-file-text-o' },
          children: report,
        },
        {
          path: 'risk',
          component: () =>
            import(/* webpackChunkName: "credit-report" */ '@/components/AliveView.vue'),
          meta: { title: '风险管理', icon: 'fa fa-fw fa-shield' },
          children: risk,
        },
        {
          path: 'user_org',
          name: 'userOrg',
          component: () =>
            import(/* webpackChunkName: "credit-user" */ '@/credit/views/city/user/Org.vue'),
          meta: { title: '组织结构', hidden: true },
        },
      ],
    },
  ],
}
